<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <h:outputStylesheet name="./default.css"/>
        <h:outputStylesheet name="./cssLayout.css"/>
        <title>Facelets Template</title>
    </h:head>

    <h:body>
        
        <div id="top" class="top">
            <ui:insert name="top">Top</ui:insert>
        </div>
        
        <div>
            <div id="left">
                <ui:insert name="left">Left</ui:insert>
            </div>
            
            <div id="content" class="left_content">
                <ui:insert name="content">Content</ui:insert>

                <h:form id="registrationform">
                    <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
            <p:panel header="Registration Form">
                <h:panelGrid columns="3" id="regGrid">
                    <h:outputLabel for="name">Name:</h:outputLabel>
                    <p:inputText id="name" value="#{registrationBean.user.userName}">
                        <p:ajax update="namemsg"/>
                    </p:inputText>
                    <p:message id="namemsg" for="name" />
                    
                    <h:outputLabel for="email">Email:</h:outputLabel>
                    <p:inputText id="email" value="#{registrationBean.user.userEmail}" >
                        <p:ajax update="emailmsg"/>
                    </p:inputText>
                    <p:message id="emailmsg" for="email" />
                    
                    <h:outputLabel for="password">Password:</h:outputLabel>
                    <p:password id="password"  required="true" requiredMessage="Input a password." value="#{registrationBean.user.userPassword}"
                                feedback="true" match="pwd2" label="Password"/>
                    <p:message for="password" />

                    <h:outputLabel for="pwd2">Confirm Password:</h:outputLabel>
                    <p:password id="pwd2" label="Confirm Password"/>
                </h:panelGrid>
                <p:commandButton id="submit" value="Register" update="regGrid"
                                 action="#{registrationBean.register()}" />

            </p:panel>
        </h:form>
        
                
            </div>
            
        </div>
    </h:body>

</html>





        
